<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>重置密码</title>
</head>
<body>
    <form action="{% url 'student_myapp:resetpassword' %}" method="post">
        {% csrf_token %}
        <p>
            <label>&emsp;&emsp;&emsp;用户名：</label>
            <input id="user" type="text" name="user" required="required" value="{{ user1 }}"/>
        </p>
        <p>
            <label>&emsp;&emsp;&emsp;邮&emsp;箱：</label>
            <input id="email" type="email" name="email" value="{{ email1 }}"/>
        </p>
        <p>
            <label>&emsp;输入新密码：</label><input id="yi" type="password" name="pwd1" value="{{ password1 }}"/>
        </p>
        <p>
            <label>再次确认密码：</label><input id="er" type="password" name="pwd2" value="{{ password2 }}"/>
            <span style="color: red">{{ show }}</span>
        </p>
        <p>
            &emsp;&emsp;&emsp;&emsp;&emsp;<input type="text" name="verification" style="height: 25px; width: 80px" required>
            <button type="button" id="get_code1" style="height: 30px" onclick="get_code()">获取验证码</button>
        </p>
        <input hidden="hidden" value="{{ datetime }}" name="get_time"/>
        <input hidden="hidden" value="{{ msg }}" name="get_msg"/>
        <p>
            &emsp;&emsp;&emsp;&emsp;&emsp;<input type="submit" value="重置密码" style="height: 40px;width: 150px; background-color: aqua"/>
        </p>
    </form>
    <script>

        function get_code() {
            var email = document.getElementById('email').value;
            var user = document.getElementById('user').value;
            var password1 = document.getElementById('yi').value;
            var password2 = document.getElementById('er').value;
            console.log(email);
            window.location.href='http://127.0.0.1/student/get_code/?email=' + email + '&user=' + user + '&password1=' + password1 + '&password2=' + password2;
        }
    </script>
</body>
</html>